home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_10
/
9n10020a
< prev
next >
Wrap
Text File
|
1991-08-12
|
985b
|
37 lines
/* --------------------------------------------------------------
FUNCTION DISPLAY_NODE: The steps to display a selected node are:
A. Complain if list empty.
B. Get a string from the user.
C. If no such node, complain else display its count and string.
-------------------------------------------------------------- */
void display_node(void)
{
Node *ploc_node; /* ptr to located node */
char string[21]; /* tmp holder for node's string */
/*A*/ if (proot_node == NULL) {
printf("\n List contains no nodes\n");
return;
}
/*B*/ printf("\n Enter string: ");
scanf("%20s", string);
/*C*/ ploc_node = locate_node(string, EXACT);
if (ploc_node == NULL) {
printf("No such node exists\n");
}
else {
printf("\t%2u >%s<\n", ploc_node->count,
ploc_node->pstring);
}
}